//
//  HDQuickGuideViewController.swift
//  CoolTennisBall
//
//  Created by Coollang on 16/7/15.
//  Copyright © 2016年 CoolLang. All rights reserved.
//

import UIKit

class HDQuickGuideViewController: UITableViewController {

    fileprivate struct Constants {
        static let HeaderHeight: CGFloat = 6.0
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

    
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        tableView.deselectRow(at: indexPath, animated: true)
        
        let controller = QuickGuidePageViewController()
        controller.modalTransitionStyle = .crossDissolve
        controller.modalPresentationStyle = .overFullScreen
        controller.currentIndexPage = indexPath.row
        controller.objc_guideTypeNum = 5;
        present(controller, animated: true, completion: nil)
    }
    
    
    override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return Constants.HeaderHeight
    }
    
    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return Constants.HeaderHeight
    }
    
    override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        
        cell.textLabel?.textColor = UIColor.white
        cell.textLabel?.highlightedTextColor = cell.textLabel?.textColor
        
        let selectionView = UIView(frame: CGRect.zero)
        selectionView.backgroundColor = UIColor(white: 0, alpha: 0.1)
        cell.selectedBackgroundView = selectionView
    }

}
